package com.example.bili.util;


import com.example.bili.entity.User;

import java.util.List;

/**
 * 分页信息
 */
public class UserPage {

    public UserPage() {
    }

    public UserPage(int pageSize, int currentPage) {
        this.pageSize = pageSize;
        this.currentPage = currentPage;
    }

    //属性
    private int pageSize=5;//每页显示的数量
    private int currentPage=1;//当前页
    private int totalPage=0;//总页数
    private int count;//总共几条数据

    private List<User> hotList;


    public List<User> getHotList() {
        return hotList;
    }

    public void setHotList(List<User> hotList) {
        this.hotList = hotList;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getCount() {
        return count;
    }

    //赋值,总数量
    public void setCount(int count) {
        this.count = count;
        //自动计算总页数
        if(this.count%this.pageSize==0) { //余数为0的时候
            this.totalPage = count / this.pageSize;
        } else {
            this.totalPage = count / this.pageSize + 1;
        }
    }


}
